<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.vortex.zj.chinamobile.com/jsapi/0.3.3/jsapi.min.js"></script>
<script src="https://cdn.bootcss.com/vConsole/3.2.0/vconsole.min.js"></script>
<script>
    //初始化一下就可以了，
    let vConsole = new VConsole();
    //你打印的数据 比如
    console.log('test');
    //就可像小程序一样的看了和调试了。
    </script>


</head>
<body>
  <button id="scan">click</button>
  <input id="text" type="text"/>
  <script>
    var text = document.getElementById("text");
      var scan = document.getElementById("scan");
    scan.onclick = () => {
      console.log('click');

      mcrm.biz.scan({
        onSuccess: res => {
          console.log(res); // res:{text : String}
          text.innerHTML = res.text;
        },
        onFail: res => {
          console.log(res);
          text.innerHTML = res.text;
        }
      });
    }
  </script>
</body>
</html>